package com.xnchat.pro.utils;

import lombok.Data;

import javax.crypto.interfaces.PBEKey;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
/**
 * @author 小凝
 */
@Data
public class NormalReturn implements Serializable {
    public static final int SUCCESS_CODE = 200;
    public static final int FAIL_CODE = 500;
    public static final NormalReturn SUCCESS = new NormalReturn(SUCCESS_CODE,null);
    public static final NormalReturn FAIL = new NormalReturn(FAIL_CODE,null);
    private int code;
    private String message;
    private Map<String,Object> info=new HashMap<>();

    public NormalReturn add(String key,Object value){
        info.put(key,value);
        return this;
    }
    public NormalReturn(int code, String message) {
        this.code = code;
        this.message = message;
    }
    public NormalReturn(){}
    public NormalReturn addMessage(String message){
        this.message=message;
        return this;
    }
}
